<tagLib name="html" /> 
<include file="Public:top" />
<style>
input{margin-bottom:10p;}
tr{ height:34px;}
</style>
<div id="main" class="" >
<div class="content">
<div class="title">新增校舍安全信息 [ <a href="__URL__">返回列表</a> ]</div>
<form method='post' id="form1" action="__URL__/insert/" >
  <table width="95%" cellpadding="3" cellspacing="3" id="tb1">
    <tr>
      <td width="12%" class="tRight" >预警标题：</td>
      <td width="31%" class="tLeft" ><input name="title" type="text" class="large bLeft" id="title" title="预警标题" value="{$vo.title}"/></td>
      <td width="8%" class="tRight" >&nbsp;</td>
      <td width="14%" class="tRight">预警时间：</td>
      <td width="34%" class="tLeft"><input type="text" class="large bLeft" id="alertDate" name="alertDate" value="" title="预警时间" /></td>
      <td width="1%" class="tLeft">&nbsp;</td>
    </tr>
    <tr>
      <td class="tRight" >单位名称：</td>
      <td class="tLeft" ><!--<select id="cc" class="easyui-combobox" name="dwmc1"></select>-->
        <input type="text" class="large bLeft" id="ccc" name="ccc" value="{$vo.dwmc}" title="请在正文列表中选择单位" editable="false"/>
        <input name="dwmc" id="dwmc" type="hidden" value="{$vo.dwmc}" />
        <input name="dwid" id="dwid" type="hidden" value="{$vo.dwid}" /></td>
      <td class="tRight" >&nbsp;</td>
      <td class="tRight">提前天数：</td>
      <td class="tLeft"><input type="number" class="medium bLeft" id="preDay" name="preDay" value="{$vo.preDay}" title="提前天数" /></td>
      <td class="tLeft">&nbsp;</td>
    </tr>
    <tr>
      <td class="tRight">备注信息：</td>
      <td colspan="4" rowspan="6" align="left" valign="top" class="tLeft" id="dlg_remarks"><div id="div_remarks" style="min-height:300px; width:80%;">{$vo.remarks}</div></td>
      <td class="tLeft">&nbsp;</td>
    </tr>
    <tr>
      <td class="tRight">&nbsp;</td>
      <td class="tLeft">&nbsp;</td>
    </tr>
    <tr>
      <td class="tRight">&nbsp;</td>
      <td class="tLeft">&nbsp;</td>
    </tr>
    <tr>
      <td class="tRight">&nbsp;</td>
      <td class="tLeft" >&nbsp;</td>
    </tr>
    <tr>
      <td class="tRight">&nbsp;</td>
      <td class="tLeft" >&nbsp;</td>
    </tr>
    <tr>
      <td class="tRight" >&nbsp;</td>
      <td class="tLeft" >&nbsp;</td>
    </tr>
    <tr>
      <td></td>
      <td class="center"><input type="hidden" name="id" value="{$vo.id}" />
        <input type="button" value="保 存" onclick="save()" class="small submit" />
        <!--<input type="reset" class="submit  small" value="清 空" />--></td>
      <td></td>
      <td></td>
      <td align="left" valign="top" class="tLeft huge" >&nbsp;</td>
      <td class="center"></td>
    </tr>
  </table>
</form>
</div>
</div>
<include file="Public:footer" />
<div class="hide" style="height:100%" id="hideDiv">
	<!--<div id="dlg_remarks" class="dlg"><div id="div_remarks" class="dlg1">{$vo.remarks}</div></div>-->
  	<div id="tempDiv"></div>   
</div>
<div id="popSchool" class="hide">
<ul id="tList"><li>公办中学</li><li>公办小学</li><li>公办幼儿园</li><li>局直属单位</li></ul>
<ul id="sList"></ul>
</div>
<script>
jQuery(function(){
	$.post("__URL__/showSchoolList/",0,function(data){
			for(i=0;i<data.length;i++){
				$('#sList').append("<li sID="+ data[i]['id'] +" sType="+ data[i]['sType'] +">"+data[i]['sName'].substring()+"</li>")
			}//for	
			$('#sList li').addClass("hand").hover(function(){
			  $(this).addClass("bg_green");
			},function () {
			  $(this).removeClass("bg_green");
			})//hover
			$('#sList li').click(function(){
				sType 	= $(this).attr("sType");
				sID		= $(this).attr("sID");
				sName	= $(this).text();
				$('#dwid').val(sID);   
				$('#dwmc').val(sName); 
				$('#ccc').val(sName); 
			}).hide()//click
		}//function
	,"json");//post	
		
	$('#ccc').popDiv({"targetDiv" : "popSchool"});
	$('#popSchool li').addClass("hand").hover(function(){
			$(this).addClass("bg_green");
		  },function () {
			$(this).removeClass("bg_green");
	}).click(function(){
		$('#sList li').hide();
		$("#sList li[sType='"+$(this).html()+"']").show();
	})//click
	
	ff='remarks';
	if($('#div_'+ff).html().length<5){
		editor = showEditor(ff,0,300);
	}else{
		jQuery('#dlg_'+ff).one('dblclick',function(){
			editor = showEditor(ff,0,300);
		})
	}
	
	if($('#alertDate1').val()){ 
		$('#alertDate').val(getLocalTime($('#alertDate1').val()));}
	$('#alertDate').datebox(); 
	
	$("#form1 :input").tooltip({
		position: "center right",
		offset: [-2, 10],
		effect: "fade",
		opacity: 0.7
	});
})
function save(){
	if(editor)$('#remarks').val(editor.html());
	var inputs = $("#form1 :input").validator({ lang: 'zh',position: 'right left',offset: [-12, 0],message: '<div><em/></div>' });//检测表单
	if(inputs.data("validator").checkValidity()){
		$.post("__URL__/insert/",$('#form1').serialize(),function(data){
			$.messager.show({title:'提示信息',msg:data.info,timeout:2000,showType:'slide'});
		}//function
		,"json");//post	
	}//if
}
</script>